package top.wshape1.shiziapi.common.domain.vo;

import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * @author Wshape1
 * @version 1.0
 * @description
 * @since 2023-09-12
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
public class PageVo implements Serializable {

    private static final long serialVersionUID = 1L;

    private long total;

    private long pageSize;

    private long currentPage;

    private long totalPage;

    private List<?> list;

    public PageVo(IPage<?> page) {
        this.total = page.getTotal();
        this.pageSize = page.getSize();
        this.totalPage = page.getPages();
        this.currentPage = page.getCurrent();
        this.list = page.getRecords();
    }

}
